package cn.itcast.nems.journal.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.jetbrains.annotations.NotNull;

import java.time.LocalDateTime;

@Data
public class JournalTransferLineDiscountVDto implements Comparable<JournalTransferLineDiscountVDto>{
    private String id;
    private String journalTransferId;
    private String journalTransferLineId;
    private String studentRecordId;
    private Integer discountId;
    private String discountName;
    private String discountType;
    /**
     * 优惠范围类型；枚举值：一般｜NORMAL、个人｜PERSONAL
     */
    private String discountScopeType ;
    /**
     * 优惠凭单行ID
     */
    private String journalDiscountLineId ;
    private Integer discountAmount;
    private String discountAmountFormatted;
    private String sort;
    private String description;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createdDatetime ;


    @Override
    public int compareTo(@NotNull JournalTransferLineDiscountVDto o) {
        return this.getCreatedDatetime().compareTo(o.getCreatedDatetime());
    }
}
